package org.demo.quartz.listener;

import com.alibaba.druid.support.json.JSONUtils;
import org.quartz.JobExecutionContext;
import org.quartz.Trigger;
import org.quartz.TriggerListener;

public class TestTriggerListener implements TriggerListener {
    @Override
    public String getName() {
        return "TestTriggerListener";
    }

    @Override
    public void triggerFired(Trigger trigger, JobExecutionContext context) {
        System.out.println("YH:triggerFired  "+ context);
    }

    @Override
    public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context) {
        return false;
    }

    @Override
    public void triggerMisfired(Trigger trigger) {
        System.out.println(trigger.getKey().getName()+" triggerMisfired：");
    }

    @Override
    public void triggerComplete(Trigger trigger, JobExecutionContext context,
                                Trigger.CompletedExecutionInstruction triggerInstructionCode) {
        System.out.println(trigger.getKey().getName()+" 执行成功："+ triggerInstructionCode);
    }
}
